Skip to content

MAINT: upgrade anaconda=2025.06 and python=3.13 #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

mmcky
Copy link
Contributor

@mmcky mmcky commented Jul 29, 2025

This PR upgrades

  • ananconda=2025.06
  • python=3.13

and associated compatible build infrastructure.

Tasks

@github-actions github-actions bot temporarily deployed to commit July 30, 2025 00:00 Inactive
@mmcky
Copy link
Contributor Author

mmcky commented Jul 30, 2025

  • fix execution incompatibilities with anaconda=2025.06 and numpy>=2.0

amss.err.log
amss2.err.log
amss3.err.log
match_transport.err.log

Copy link

netlify bot commented Aug 5, 2025

Deploy Preview for lustrous-melomakarona-3ee73e ready!

Name Link
🔨 Latest commit fbc8121
🔍 Latest deploy log https://app.netlify.com/projects/lustrous-melomakarona-3ee73e/deploys/6892a8ac582be800088e8076
😎 Deploy Preview https://deploy-preview-215--lustrous-melomakarona-3ee73e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mmcky
Copy link
Contributor Author

mmcky commented Aug 25, 2025

@kp992 this is currently blocked by amss and the interpolations package.

There are some suggestions in #223

We were thinking of Step 1 removing our dependency on interpolations then Step 2 look at converting this lecture to JAX. @HumphreyYang and I gave copilot a go in #244 if those ideas are helpful. Also please liaise with @HumphreyYang through #236 for the jax translation but I think Step 1 would be good to do first.

@kp992
Copy link
Collaborator

kp992 commented Aug 25, 2025

Thanks @mmcky. I will look into it.

@HumphreyYang
Copy link
Member

HumphreyYang commented Aug 25, 2025

Many thanks @mmcky and @kp992,

There is a drop-in replacement for the interpolation in #228.

We can move it into one of script in the static Python file.

This produces the same figures.

Here is a copy of the replacement if that is helpful:

@njit
def get_grid_nodes(grid):
    """
    Get the actual grid points from a grid tuple.
    """
    x_min, x_max, x_num = grid
    return np.linspace(x_min, x_max, x_num)

@njit
def linear_interp_1d_scalar(x_min, x_max, x_num, y_values, x_val):
    """Helper function for scalar interpolation"""
    x_nodes = np.linspace(x_min, x_max, x_num)

    # Extrapolation with linear extension
    if x_val <= x_nodes[0]:
        # Linear extrapolation using first two points
        if x_num >= 2:
            slope = (y_values[1] - y_values[0]) / (x_nodes[1] - x_nodes[0])
            return y_values[0] + slope * (x_val - x_nodes[0])
        else:
            return y_values[0]

    if x_val >= x_nodes[-1]:
        # Linear extrapolation using last two points
        if x_num >= 2:
            slope = (y_values[-1] - y_values[-2]) / (x_nodes[-1] - x_nodes[-2])
            return y_values[-1] + slope * (x_val - x_nodes[-1])
        else:
            return y_values[-1]

    # Binary search for the right interval
    left = 0
    right = x_num - 1
    while right - left > 1:
        mid = (left + right) // 2
        if x_nodes[mid] <= x_val:
            left = mid
        else:
            right = mid

    # Linear interpolation
    x_left = x_nodes[left]
    x_right = x_nodes[right]
    y_left = y_values[left]
    y_right = y_values[right]

    weight = (x_val - x_left) / (x_right - x_left)
    return y_left * (1 - weight) + y_right * weight

@njit
def linear_interp_1d(x_grid, y_values, x_query):
    """
    Perform 1D linear interpolation.
    """
    x_min, x_max, x_num = x_grid
    return linear_interp_1d_scalar(x_min, x_max, x_num, y_values, x_query[0])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants